package qq_by_qun

import (
	"github.com/streadway/amqp"
	"log"
	"qq_service/server/base/msg_queue/rabbit/lib"
)

func receive() {

	mq := lib.NewMQ()
	data := []string{}
	mq.Consume(lib.QueueNewUser, "QQ_by_Qun", "QQ_by_Qun", func(deliveries <-chan amqp.Delivery, s string) {
		for v := range deliveries {
			data = append(data, string(v.Body))
			err := v.Ack(false)
			if err != nil {
				log.Fatal(err)
			}
		}
	})

}

func QQbyQun() {

	lib.MQInit()

	go receive()

}
